package m2.port;

import m2.Composant;
import m2.service.ServiceRequis;

public class PortRequis extends PortConfigRequis {
	protected Composant composant;
	protected ServiceRequis serviceRequis;

	public PortRequis(String name) {
		super(name);
	}

	public ServiceRequis getServiceRequis() {
		return serviceRequis;
	}

	public void setServiceRequis(ServiceRequis serviceRequis) {
		this.addObserver(serviceRequis);
		this.serviceRequis = serviceRequis;
	}

	public void setComposant(Composant c) {
		this.composant = c;
	}

	public Composant getComposant() {
		return composant;
	}

	@Override
	public void update(Object o, Object arg) {
			System.out.println("=========== Composant :"
					+ this.composant.getName()
					+ "===========");
			System.out.println("Message Recu: " + arg);
			System.out.println("======================================");
		notifyObservers(arg);
	}

}
